from abc import ABCMeta, abstractmethod

from vnpy_ctp.core.object import OrderRequest, TradeData, OrderData, PositionData, AccountData, QuoteData


class BaseTrader(metaclass=ABCMeta):
    @abstractmethod
    def buy(self, order: OrderRequest):
        pass

    @abstractmethod
    def sell(self, order: OrderRequest):
        pass

    @abstractmethod
    def on_trade(self, trade: TradeData) -> None:
        """
        Trade event push.
        Trade event of a specific vt_symbol is also pushed.
        """

    @abstractmethod
    def on_order(self, order: OrderData) -> None:
        """
        Order event push.
        Order event of a specific vt_orderid is also pushed.
        """

    @abstractmethod
    def on_position(self, position: PositionData) -> None:
        """
        Position event push.
        Position event of a specific vt_symbol is also pushed.
        """

    @abstractmethod
    def on_account(self, account: AccountData) -> None:
        """
        Account event push.
        Account event of a specific vt_accountid is also pushed.
        """
    @abstractmethod
    def on_quote(self, quote: QuoteData) -> None:
        """
        Quote event push.
        Quote event of a specific vt_symbol is also pushed.
        """
